package com.study.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class SimpleTask {
	
	@Scheduled(cron = "0/10 * * * * ?")
	@TaskRedisConfig(key="simpleTask:methodOne",timeout="9",index="2")
	@Transactional
	public void methodOne() {
		System.out.println("methodOne----,时间：" + System.currentTimeMillis()/1000);
	}
	
	@Scheduled(cron = "0/20 * * * * ?")
	@TaskRedisConfig(key="simpleTask:methodTwo",timeout="18",index="2")
	public void methodTwo() {
		System.out.println("methodTwo----,时间：" + System.currentTimeMillis()/1000);
	}

}
